//
//  NSObject+Helper.m
//  ruying
//
//  Created by yqh on 2019/2/23.
//  Copyright © 2019年 林伟钦. All rights reserved.
//

#import "NSObject+Helper.h"

@implementation NSObject (Helper)

+ (NSString *)name {
    return NSStringFromClass([self class]);
}

+ (BOOL)objcIsNull:(id)obj {
    if (obj == nil || [obj isEqual:[NSNull null]]) {
        return YES;
    } else if ([obj isKindOfClass:[NSString class]]) {
        if ([(NSString *)obj isEqualToString:@""]) {
            return YES;
        }
    } else if ([obj isKindOfClass:[NSNumber class]]) {
        if ([(NSNumber *)obj isEqualToNumber:@0]) {
            return YES;
        }
    } else if ([obj isKindOfClass:[NSArray class]]) {
        if (((NSArray *)obj).count <= 0) {
            return YES;
        }
    } else if ([obj isKindOfClass:[NSDictionary class]]) {
        if (((NSDictionary *)obj).count <= 0) {
            return YES;
        }
    }
    return NO;
}

@end
